<!---------fovourite Listing  Block starts here -->
	<?php if($id == $session->read('Auth.User.id'))
	{?>
		<?php $title = __('Your Favourite Listings',true)?>
		<?php $urlParam = "myFavorites"?>
	<?php }else{?>
		<?php $title = sprintf(__('Favoured By %s'),$user['User']['username']);?>
		<?php $urlParam = "userFavorites"?>
	<?php }?><div class="clear"></div>
	<?php
		$favouriteListingIds = cri('Users.UserFavorite')->find('list',array('fields'=>array('item_id','item_id'),'conditions'=>array('user_id'=>$id,'type'=>'Listing')));
		if(!empty($favouriteListingIds))
		{?>
		<h3>
			<span class="fl">
				<?php echo $title?>
			</span>
			<span class="fr all"><?php echo $html->link(__('All Listings'),SiteUrl::getUrl($urlParam,array($user['User']['slug'])));?>
			</span>
			<div class="clear"></div>
		</h3>

		<?php
			$favouriteListings = cri('Listing')->find('all',array('conditions'=>array('Listing.id'=>$favouriteListingIds,'Listing.status'=>1),'recursive'=>1,'limit'=>4));
			echo $this->element('listings',array('listings'=>$favouriteListings,'view_type'=>cr('ListingConfig.view_type')));
		?>			
<?php }?>
<div class="clear"></div>
<!---------fovourite Listing  Block ends here --------------------->